<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionDispatch::TestRequest</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActionDispatch::TestRequest 
            
                <span class="parent">&lt; 
                    
                    <a href="Request.html">ActionDispatch::Request</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../files/actionpack/lib/action_dispatch/testing/test_request_rb.html">actionpack/lib/action_dispatch/testing/test_request.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>A</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TestRequest.html#method-i-accept-3D">accept=</a>,
              </li>
            
              
              <li>
                <a href="TestRequest.html#method-i-action-3D">action=</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TestRequest.html#method-i-cookies">cookies</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>H</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TestRequest.html#method-i-host-3D">host=</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>I</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TestRequest.html#method-i-if_modified_since-3D">if_modified_since=</a>,
              </li>
            
              
              <li>
                <a href="TestRequest.html#method-i-if_none_match-3D">if_none_match=</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TestRequest.html#method-c-new">new</a>,
              </li>
            
              
              <li>
                <a href="TestRequest.html#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>P</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TestRequest.html#method-i-path-3D">path=</a>,
              </li>
            
              
              <li>
                <a href="TestRequest.html#method-i-port-3D">port=</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>R</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TestRequest.html#method-i-rack_cookies">rack_cookies</a>,
              </li>
            
              
              <li>
                <a href="TestRequest.html#method-i-remote_addr-3D">remote_addr=</a>,
              </li>
            
              
              <li>
                <a href="TestRequest.html#method-i-request_method-3D">request_method=</a>,
              </li>
            
              
              <li>
                <a href="TestRequest.html#method-i-request_uri-3D">request_uri=</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>U</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="TestRequest.html#method-i-user_agent-3D">user_agent=</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    
      <!-- Section constants -->
      <div class="sectiontitle">Constants</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class="attr-name">DEFAULT_ENV</td>
            <td>=</td>
            <td class="attr-value">Rack::MockRequest.env_for('/')</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
      </table>
    


    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(env = {})
            
            <a href="TestRequest.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L8" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 8</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span> = {})
  <span class="ruby-keyword">super</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(env = {})
            
            <a href="TestRequest.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L12" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 12</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">env</span> = {})
  <span class="ruby-identifier">env</span> = <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">application</span>.<span class="ruby-identifier">env_config</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">env</span>) <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-constant">Rails</span>.<span class="ruby-identifier">application</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">application</span>
  <span class="ruby-keyword">super</span>(<span class="ruby-identifier">default_env</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">env</span>))

  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">host</span>        = <span class="ruby-string">'test.host'</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">remote_addr</span> = <span class="ruby-string">'0.0.0.0'</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">user_agent</span>  = <span class="ruby-string">'Rails Testing'</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-accept-3D">
            
              <b>accept=</b>(mime_types)
            
            <a href="TestRequest.html#method-i-accept-3D" name="method-i-accept-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-accept-3D_source')" id="l_method-i-accept-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L61" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-accept-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 61</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">accept=</span>(<span class="ruby-identifier">mime_types</span>)
  <span class="ruby-ivar">@env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">'action_dispatch.request.accepts'</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'HTTP_ACCEPT'</span>] = <span class="ruby-constant">Array</span>(<span class="ruby-identifier">mime_types</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mime_type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mime_type</span>.<span class="ruby-identifier">to_s</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;,&quot;</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-action-3D">
            
              <b>action=</b>(action_name)
            
            <a href="TestRequest.html#method-i-action-3D" name="method-i-action-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-action-3D_source')" id="l_method-i-action-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L41" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-action-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 41</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">action=</span>(<span class="ruby-identifier">action_name</span>)
  <span class="ruby-identifier">path_parameters</span>[<span class="ruby-string">&quot;action&quot;</span>] = <span class="ruby-identifier">action_name</span>.<span class="ruby-identifier">to_s</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-cookies">
            
              <b>cookies</b>()
            
            <a href="TestRequest.html#method-i-cookies" name="method-i-cookies" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
            <div class="aka">
              Also aliased as: <a href="TestRequest.html#method-i-rack_cookies">rack_cookies</a>
            </div>
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-cookies_source')" id="l_method-i-cookies_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L68" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-cookies_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 68</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">cookies</span>
  <span class="ruby-ivar">@cookies</span> <span class="ruby-operator">||=</span> {}.<span class="ruby-identifier">with_indifferent_access</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-host-3D">
            
              <b>host=</b>(host)
            
            <a href="TestRequest.html#method-i-host-3D" name="method-i-host-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-host-3D_source')" id="l_method-i-host-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L25" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-host-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 25</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">host=</span>(<span class="ruby-identifier">host</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'HTTP_HOST'</span>] = <span class="ruby-identifier">host</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-if_modified_since-3D">
            
              <b>if_modified_since=</b>(last_modified)
            
            <a href="TestRequest.html#method-i-if_modified_since-3D" name="method-i-if_modified_since-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-if_modified_since-3D_source')" id="l_method-i-if_modified_since-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L45" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-if_modified_since-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 45</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">if_modified_since=</span>(<span class="ruby-identifier">last_modified</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'HTTP_IF_MODIFIED_SINCE'</span>] = <span class="ruby-identifier">last_modified</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-if_none_match-3D">
            
              <b>if_none_match=</b>(etag)
            
            <a href="TestRequest.html#method-i-if_none_match-3D" name="method-i-if_none_match-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-if_none_match-3D_source')" id="l_method-i-if_none_match-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L49" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-if_none_match-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 49</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">if_none_match=</span>(<span class="ruby-identifier">etag</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'HTTP_IF_NONE_MATCH'</span>] = <span class="ruby-identifier">etag</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-path-3D">
            
              <b>path=</b>(path)
            
            <a href="TestRequest.html#method-i-path-3D" name="method-i-path-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-path-3D_source')" id="l_method-i-path-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L37" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-path-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 37</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">path=</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'PATH_INFO'</span>] = <span class="ruby-identifier">path</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-port-3D">
            
              <b>port=</b>(number)
            
            <a href="TestRequest.html#method-i-port-3D" name="method-i-port-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-port-3D_source')" id="l_method-i-port-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L29" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-port-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">port=</span>(<span class="ruby-identifier">number</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'SERVER_PORT'</span>] = <span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-rack_cookies">
            
              <b>rack_cookies</b>()
            
            <a href="TestRequest.html#method-i-rack_cookies" name="method-i-rack_cookies" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-remote_addr-3D">
            
              <b>remote_addr=</b>(addr)
            
            <a href="TestRequest.html#method-i-remote_addr-3D" name="method-i-remote_addr-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-remote_addr-3D_source')" id="l_method-i-remote_addr-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L53" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-remote_addr-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 53</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">remote_addr=</span>(<span class="ruby-identifier">addr</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'REMOTE_ADDR'</span>] = <span class="ruby-identifier">addr</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-request_method-3D">
            
              <b>request_method=</b>(method)
            
            <a href="TestRequest.html#method-i-request_method-3D" name="method-i-request_method-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-request_method-3D_source')" id="l_method-i-request_method-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L21" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-request_method-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 21</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">request_method=</span>(<span class="ruby-identifier">method</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'REQUEST_METHOD'</span>] = <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-request_uri-3D">
            
              <b>request_uri=</b>(uri)
            
            <a href="TestRequest.html#method-i-request_uri-3D" name="method-i-request_uri-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-request_uri-3D_source')" id="l_method-i-request_uri-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L33" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-request_uri-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 33</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">request_uri=</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'REQUEST_URI'</span>] = <span class="ruby-identifier">uri</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-user_agent-3D">
            
              <b>user_agent=</b>(user_agent)
            
            <a href="TestRequest.html#method-i-user_agent-3D" name="method-i-user_agent-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-user_agent-3D_source')" id="l_method-i-user_agent-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/8f58d6e5074a623bed752d5ba38513305f03fae9/actionpack/lib/action_dispatch/testing/test_request.rb#L57" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-user_agent-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/testing/test_request.rb, line 57</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">user_agent=</span>(<span class="ruby-identifier">user_agent</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-string">'HTTP_USER_AGENT'</span>] = <span class="ruby-identifier">user_agent</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    